package com.aspose.cells;

import java.util.ArrayList;
import java.util.Iterator;

class zqy {
   private zqx a;
   private zkj b;
   private zra c;
   private ShapeCollection d;

   zqy(ShapeCollection var1, zra var2, int var3) {
      this.c = var2;
      this.d = var1;
      this.a = new zqx(var3);
   }

   zqy(ShapeCollection var1, zra var2, int var3, int var4) {
      this.c = var2;
      this.d = var1;
      this.a = new zqx(var3, var4);
   }

   zra a() {
      return this.c;
   }

   WorksheetCollection b() {
      return this.d.i();
   }

   int a(Shape var1, byte[] var2) {
      this.c().a(this.a(), 1);
      var1.N().i().b(this.c().c());
      return var2 != null ? this.c.a(var2) : 0;
   }

   void a(Shape var1) {
      this.c().a(this.a(), 1);
      var1.N().i().b(this.c().c());
   }

   zqx c() {
      return this.a;
   }

   zkj d() {
      if (this.b == null) {
         this.b = new zkj();
      }

      return this.b;
   }

   long e() {
      long var1 = 48L;
      Iterator var3 = this.d.iterator();

      while(var3.hasNext()) {
         Shape var4 = (Shape)var3.next();
         if (var4.U()) {
            switch(var4.getMsoDrawingType()) {
            case 20:
               Object var5 = ((ComboBox)var4).a();
               if (var5 instanceof AutoFilter) {
                  var1 += (long)(((AutoFilter)var5).e() * 90);
               } else if (var5 instanceof PivotTable) {
                  PivotTable var6 = (PivotTable)var5;
                  var1 += (long)(var6.getPageFields().getCount() * 90);
               } else {
                  var1 += 90L;
               }
               break;
            default:
               var1 += 90L;
            }
         } else {
            var1 += (long)var4.T();
         }
      }

      return var1;
   }

   int f() {
      int var1 = this.c().d() + 8 + 8;
      if (this.b != null) {
         var1 += this.b.a();
      }

      return var1;
   }

   int g() {
      ArrayList var1 = this.c.d().c();

      for(int var2 = 0; var2 < var1.size(); ++var2) {
         zva var3 = (zva)var1.get(var2);
         if (var3.a == (this.c().a() & '\uffff')) {
            return (var2 + 1) * 1024;
         }
      }

      return 1024;
   }

   int a(byte[] var1, int var2, int var3, int var4) {
      var1[var2] = 15;
      var1[var2 + 2] = 2;
      var1[var2 + 3] = -16;
      System.arraycopy(com.aspose.cells.b.a.zc.a(var3), 0, var1, var2 + 4, 4);
      var2 += 8;
      byte var5 = 0;
      int var6 = var5 | this.c().a() << 4;
      System.arraycopy(com.aspose.cells.b.a.zc.a(var6), 0, var1, var2, 2);
      var1[var2 + 2] = 8;
      var1[var2 + 3] = -16;
      var1[var2 + 4] = 8;
      var2 += 8;
      System.arraycopy(com.aspose.cells.b.a.zc.a(this.c().b()), 0, var1, var2, 4);
      System.arraycopy(com.aspose.cells.b.a.zc.a(this.c().c()), 0, var1, var2 + 4, 4);
      var2 += 8;
      var1[var2] = 15;
      var1[var2 + 2] = 3;
      var1[var2 + 3] = -16;
      System.arraycopy(com.aspose.cells.b.a.zc.a(var4), 0, var1, var2 + 4, 4);
      var2 += 8;
      var1[var2] = 15;
      var1[var2 + 2] = 4;
      var1[var2 + 3] = -16;
      var1[var2 + 4] = 40;
      var2 += 8;
      var1[var2] = 1;
      var1[var2 + 2] = 9;
      var1[var2 + 3] = -16;
      var1[var2 + 4] = 16;
      var2 += 24;
      var1[var2] = 2;
      var1[var2 + 2] = 10;
      var1[var2 + 3] = -16;
      var1[var2 + 4] = 8;
      var2 += 8;
      System.arraycopy(com.aspose.cells.b.a.zc.a(this.g()), 0, var1, var2, 4);
      var1[var2 + 4] = 5;
      var2 += 8;
      return var2;
   }
}
